package com.dpteam.dao.impl;

import com.dpteam.dao.RejectReasonDao;
import com.dpteam.model.RejectReason;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by xwh on 2016/1/7.
 */
@Repository
public class RejectReasonDaoImpl extends BaseDaoImpl<RejectReason> implements RejectReasonDao {

    @Override
    public List<RejectReason> findAllRejectReason() {
        String hql = "from RejectReason order by id ";
        return find(hql);
    }

    @Override
    public void deleteById(int id) {
        RejectReason rejectReason = get(RejectReason.class, id);
        if (rejectReason != null) {
            delete(rejectReason);
        }
    }
}
